/**
 *
 */
package com.googlecode.bip.xml.export;

import java.io.IOException;

/**
 * Handle XML export from MySQL database
 */
// not public
class XMLTopicLocal implements XMLAppender
{
    private static final long serialVersionUID = 1L;
    private String idlocal;
    private String topicname;
    private String topicdescription;

    public XMLTopicLocal(
            String idlocal,
            String topicname,
            String topicdescription
            )
    {
        this.idlocal = idlocal;
        this.topicname = topicname;
        this.topicdescription = topicdescription;
    }

    /**
     * <XMP>
     * <!ELEMENT topiclocal        (local,topicname,topicdescription)>
     * <!ELEMENT local             (#PCDATA)>
     * <!ELEMENT topicname         (#PCDATA)>
     * <!ELEMENT topicdescription  (#PCDATA)>
     * </XMP>
     */
    @Override
    public void appendXML( Appendable a ) throws IOException
    {
        a.append( "<topiclocal>\n" );

        XMLAppenderHelper.appendXMLValue( a, "local", idlocal );
        XMLAppenderHelper.appendXMLValue( a, "topicname", topicname );
        XMLAppenderHelper.appendXMLValue( a, "topicdescription", topicdescription );

        a.append( "</topiclocal>\n" );
    }

}
